package service;

import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import dao.UserDao;
import pojo.User;

@Service(value="userservice")
public class UserServiceImpl implements UserService {
	
	@Resource(name="userdao")
	private UserDao ud;

	@Override
	public User addUser(User u) {
		u.setId(UUID.randomUUID().toString());
		ud.addUser(u);
		return u;
	}

	@Override
	public User findUser(User user) {
		User u=ud.findUser(user);
		return u;
	}

}
